Connect the S-function

The TPT S-function is ready to be placed into the test model. All inputs and outputs that were previously defined in the IO-file are displayed alongside the output tpt_status and the input tpt_command. There are five steps to be done:

  1. All stimuli and outputs of the SUT must be connected.
  2. To stop the simulation once the trial is finished, the output tpt-status of the S-function needs to be connected to a terminator block.
  3. To inform the TPT-VM about the MiL-environment, a constant value of uint8(3) needs to be set and connected to the input tpt_command.
  4. To resolve the algebraic loop inside the test model, a memory block needs to be placed into the patch between the SUT output and the input of the TPT S-function.
  5. Update the model (Edit | Update Diagram or click Ctrl+D) to check the test frame for eventual errors and compile automatically the following files in the directory of the test frame: <test frame>.c, <test frame>.mexw32, and <test frame>.tlc .
If the model to be tested requires a lot of inputs and outputs, it might be easier to combine all input signals in the bus and demux it after the SUT.

Connecting the SUT and TPT S-function